<!DOCTYPE HTML>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>

    <link href="/css/H-ui.min.css" rel="stylesheet" type="text/css"/>
    <link href="/css/H-ui.admin.css" rel="stylesheet" type="text/css"/>
    <link href="/lib/font-awesome/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <link href="/lib/iconfont/iconfont.css" rel="stylesheet" type="text/css"/>
    <link href="/command/bootstrap-4.4.1-dist/css/bootstrap.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="/lib/jquery.min.js"></script>
    <script type="text/javascript" src="/command/bootstrap-4.4.1-dist/js/bootstrap.js"></script>
    <title>公众号管理</title>
</head>
<body>
<div class="cl pd-5 bg-1 bk-gray mt-20"><span class="l">
    <a href="javascript:;" onclick="deleteSelect()"
       class="btn btn-danger radius"><i class="icon-trash"></i> 批量删除</a>
    <a
        href="javascript:;" onclick="user_add('550','','添加公众号','/gzhForm')" class="btn btn-primary radius"><i
        class="icon-plus"></i> 添加公众号</a>
<!--    <a th:href="@{'/index'}"-->
<!--       class="btn btn-primary radius">-->
<!--    <i class="icon-plus"></i> 返回主页</a>-->
</span></div>
<table class="table table-border table-bordered table-hover table-bg table-sort">
    <thead>
    <tr class="text-c">
        <th><input type="checkbox" name="" value=""></th>
        <th>ID</th>
        <th>公众号</th>
        <th>发布次数</th>
        <th>总阅读数</th>
        <th>头条阅读数</th>
        <th>平均阅读数</th>
        <th>平均在看数</th>
        <th>粉丝数</th>
        <th>类型</th>
        <th>指数</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="gzh : ${gzhList}" class="text-c" th:if="${count}!=0">
        <td><input type="checkbox" name="id[]" id="id[]" th:value="${gzh.id}"></td>
        <td th:text="${gzh.id}">1</td>
        <td th:text="${gzh.hname}">应用名</td>
        <td th:text="${gzh.releasetimes}">1</td>
        <td th:text="${gzh.totalreadings}">1</td>
        <td th:text="${gzh.headreading}">类型</td>
        <td th:text="${gzh.averagereading}">40921</td>
        <td th:text="${gzh.averagelooking}">11</td>
        <td th:text="${gzh.numberoffans}">11</td>
        <td th:text="${gzh.htype}">2014-6-11</td>
        <td th:text="${gzh.zhishu}">1</td>
        <td class="f-14 user-manage"></a>
            <a title="编辑" href="javascript:;"

               style="text-decoration:none"
               th:href="@{'/modifyGzh/'+${gzh.id}}">
                <i class="icon-edit"></i>
            </a>
            <a title="删除"
               href="javascript:;"

               class="ml-5"
               style="text-decoration:none"
               th:href="@{'/deleteGzh/'+${gzh.id}+'&'+${pageNo}}"
            >
                <i class="icon-trash"></i></a>
        </td>
    </tr>
    <tr class="text-c">


    </tbody>
</table>

<div class="container">
    <ul class="pagination" th:if="${count}!=0">
        <li class="page-item"><a class="page-link" th:href="@{'/gzhlist/1'}" th:if="${pageNo}!=1">首页</a></li>
        <li class="page-item"><a class="page-link" aria-label="Previous" th:href="@{'/gzhlist/'+${pageNo-1}}" th:if="${pageNo}!=1">&larr;上一页</a></li>


        <span th:each="page : ${#numbers.sequence(pageNo, currMaxPage)}" class="text-c">
                <span class="page-item active" th:if="${page}==${pageNo}"><a class="page-link" th:href="@{'/gzhlist/'+${page}}" th:text="${page}"></a></span>
             <span class="page-item" th:if="${page}!=${pageNo}"><a class="page-link" th:href="@{'/gzhlist/'+${page}}" th:text="${page}"></a></span>
        </span>

        <li class="page-item"><a  class="page-link" aria-label="Next" th:href="@{'/gzhlist/'+${pageNo+1}}" th:if="${pageNo}!=${maxpage}">下一页&rarr;</a></li>
        <li class="page-item"><a class="page-link" th:href="@{'/gzhlist/'+${maxpage}}" th:if="${pageNo}!=${maxpage}">尾页</a></li>
    </ul>
</div>
<div class="container">
    <span class="page-item page-link text-center" th:text="'共'+${count}+'条数据'"></span>
</div>
<script type="text/javascript" src="/lib/jquery.min.js"></script>
<script type="text/javascript" src="/lib/layer1.8/layer.min.js"></script>
<script type="text/javascript" src="/lib/laypage/laypage.js"></script>
<script type="text/javascript" src="/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/lib/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/js/H-ui.js"></script>
<script type="text/javascript" src="/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/js/H-ui.admin.doc.js"></script>


<script>
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "//hm.baidu.com/hm.js?080836300300be57b7f34f4b3e97d911";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
    var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
    document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F080836300300be57b7f34f4b3e97d911' type='text/javascript'%3E%3C/script%3E"));
</script>

<script th:inline="javascript">
    function deleteSelect() {
        let page=[[${pageNo}]];
        let Checkbox = false;
        $("input[name='id[]']").each(function() {
            if (this.checked === true) {
                Checkbox = true;
            }
        });
        if (Checkbox) {
            let t = confirm("您确认要删除选中的内容吗？");
            if (t === false) {
                return false;
            } else {
                let checkedID="";
                $("input[name='id[]']").each(function() {
                    if (this.checked == true) {
                        checkedID += this.value + ",";
                    }
                });
                window.location.replace("/delSelectedGzh/"+checkedID+"&"+page);
            }
        } else {
            alert("请选择您要删除的内容!");
            return false;
        }
    }
</script>

</body>
</html>